﻿using System.Linq;
using AdventureWorks.DataAccess.SearchCriterias;
namespace AdventureWorks.DataAccess.Task
{
    public static class QueryableExtensions
    {
        public static IQueryable<T> Paging<T>(this IQueryable<T> query, BaseSearchCriteria searchCriteria)
        {
            return query.Skip(searchCriteria.PageSize * (searchCriteria.Page - 1)).Take(searchCriteria.PageSize);
        }
    }
}
